package com.hww.acommon.test;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;

import com.hww.acommon.R;
import com.hww.acommon.databinding.ActivityBaseBinding;

/**
 * @author hww
 * @date 0013 2024/6/13
 * email: heww@zhongyuntech.cn
 * description:
 */
public abstract class BaseActivity extends AppCompatActivity {

    protected ActivityBaseBinding binding = null;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        /*setContentView(R.layout.activity_base);*/
        binding = DataBindingUtil.setContentView(this, R.layout.activity_base);

        System.out.printf("");

        initDate();
    }

    protected abstract void initDate();

    /**
     * 若通过代码添加控件后，需要调用此方法进行请求布局更新
     */
    protected void updateLayout() {
        binding.baseScrollView.post(new Runnable() {
            @Override
            public void run() {
                binding.baseScrollView.requestLayout();
            }
        });
    }

    protected void setBTText(Button bt, String con) {
        if (null != bt) {
            bt.setVisibility(View.VISIBLE);
            bt.setText(con);
        }
    }

    protected void setGONE() {
        binding.bt1.setVisibility(View.GONE);
        binding.bt2.setVisibility(View.GONE);
        binding.bt3.setVisibility(View.GONE);
        binding.bt4.setVisibility(View.GONE);
        binding.bt5.setVisibility(View.GONE);
        binding.bt6.setVisibility(View.GONE);
        binding.bt7.setVisibility(View.GONE);
        binding.bt8.setVisibility(View.GONE);
        binding.bt9.setVisibility(View.GONE);
        binding.bt10.setVisibility(View.GONE);
        binding.bt11.setVisibility(View.GONE);
        binding.bt12.setVisibility(View.GONE);
        binding.bt13.setVisibility(View.GONE);

    }


    public void onClickBT1(View view) {
    }

    public void onClickBT2(View view) {
    }

    public void onClickBT3(View view) {
    }

    public void onClickBT4(View view) {
    }

    public void onClickBT5(View view) {
    }

    public void onClickBT6(View view) {
    }

    public void onClickBT7(View view) {
    }

    public void onClickBT8(View view) {
    }

    public void onClickBT9(View view) {
    }

    public void onClickBT10(View view) {
    }

    public void onClickBT11(View view) {
    }

    public void onClickBT12(View view) {
    }

    public void onClickBT13(View view) {
    }

}
